#ifndef DIGITVIEW_H
#define DIGITVIEW_H

#include "HexEditViewBase.h"


class DigitView: public HexEditViewBase {
  public:


    DigitView( HexEditPanel* panel );


    inline int GetDigitBits() { return m_DigitBits; }


    inline void SetDigitBits( int bits ) { m_DigitBits = bits; }


    inline bool GetLittleEndian() { return m_LittleEndian; }


    inline void SetLittleEndian( bool le ) { m_LittleEndian = le; }


    inline int GetBlockBytes() { return m_BlockBytes; }


    inline void SetBlockBytes( int blockBytes ) { m_BlockBytes = blockBytes; }

  private:


    virtual void OnActivate( bool becomesActive );


    virtual void OnCalculateBlockSize( OffsetT& blockStart, OffsetT& blockEnd );


    virtual void OnProcessChar( wxChar ch );


    virtual void OnMoveLeft();


    virtual void OnMoveRight();


    virtual void OnMoveUp();


    virtual void OnMoveDown();


    virtual void OnPutLine( OffsetT startOffset, HexEditLineBuffer& buff, char* content, int bytes );


    virtual void OnOffsetChange( int positionFlags );


    virtual int OnGetCurrentPositionFlags();


    virtual void OnGetBlockSizes( int& blockLength, int& blockBytes, int& spacing );


    virtual int OnGetOffsetFromColumn( int column, int& positionFlags );


    inline unsigned char GetMaxDigitValue();


    inline int GetHighestOffsetInByte();


    int  m_DigitBits;    ///< \brief Bits per one digit, should be 1 or 4, 2 also accepted but not practical
    int  m_BlockBytes;   ///< \brief Bytes per one block
    bool m_LittleEndian;
    int m_BitPosition;  ///< \brief Position of first bit starting selected digit
};

#endif
